# @Filename:    statistics.py
# @Author:      王佳伟
# @Time:        2025-07-17 9:51
# @Describe:    统计学函数
import pandas as pd

# 创建字典型series结构
# d = {'Name': pd.Series(['小明', '小亮', '小红', '小华', '老赵', '小曹', '小陈',
#                         '老李', '老王', '小冯', '小何', '老张']),
#      'Age': pd.Series([25, 26, 25, 23, 30, 29, 23, 34, 40, 30, 51, 46]),
#      'Rating': pd.Series([4.23, 3.24, 3.98, 2.56, 3.20, 4.6, 3.8, 3.78, 2.98, 4.80, 4.10, 3.65])
#      }
# df = pd.DataFrame(d)
# print(df)
# print("==================")

# sum 求和
# print(df.sum())
# print(df[['Age','Rating']].sum(axis=1))

# mean求均值
# print(df[['Age','Rating']].mean())

# std求标准差
# print(df[['Age','Rating']].std())

# 数据汇总描述
# print(df.describe())
# print(df.describe(include=["object"]))
# print(df.describe(include="all"))






